# A stub scoring class
# goes with CribTest2b.py
#
# This version uses the simple scoring method of:
#   10 points for every face card
#   20 points for Aces
#  100 points for the Queen of Hearts
# (Just to demonstrate how to look up suit and rank)

from Card import Card

class CribScore:
    """A class to score a specific hand"""

    def __init__(self, h):
        """Initialize with a list of cards"""

        self.h2 = h[:]  # Makes a copy, so we can destroy it
                             # I'm not sure if this is necessary

    def score(self):
        """Return score of the hand"""

        score = 0
        for c in self.h2:
            if c.getRankNum() >= 11:
                score += 10
            if c.getRank() == 'a':
                score += 20
            if c.getRank() == 'q' and c.getSuit() == 'h':
                score += 90

        return score
